import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import render from '@dfeidao/atom-web/render/render';
import p001 from './p001';
import nodejs from '@dfeidao/atom-web/msg/nodejs';
import set from '@dfeidao/atom-web/local/set';

export default async function a001(fd: IFeidaoAiBrowserComponent, d_name: string, d_level: string, nos: string) {
	//右部初始页面
	const a = fd.data.node.querySelector<HTMLSpanElement>('[data-id="risk_po_type_name"]');
	a.innerText = d_name;
	set(fd, 'd_name', d_name);
	const b = fd.data.node.querySelector<HTMLSpanElement>('[data-id="risk_level"]');
	b.innerText = d_level;
	// const c = fd.data.node.querySelectorAll<HTMLSpanElement>('[data-id="d_name1"]');
	// console.log(c);
	// const page_no = fd.data.params["page-no"] || '1';
	// console.log('zu5-1', page_no);
	const res = await nodejs<{ data: [], n: number }>('risk-point/zj-000005/s001', {
		filter: {
			page_no: 1,
			risk_po_type_name: d_name,
			risk_level: d_level,

			risk_po_type_no: nos,
			risk_po_name_no: '',
			risk_po_name: ''
		}
	});
	console.log(res);
	const render_data = Object.assign(res, { d_name });
	render(fd, res, p001, 'p001', 'inner')
	set(fd, 'd_name', d_name);
	set(fd, 'd_level', d_level);
	set(fd, 'nos', nos);
	set(fd, 'render_data', render_data.d_name);

	//risk_po_name_no
}
